import QtQuick
import QtQuick.Controls

Window {
    width: 400
    height: 400
    title: "登录"
    // visible: true
    color: "transparent"
    flags: Qt.FramelessWindowHint //无边框窗口

    Flipable {
        id: flipable
        anchors.fill: parent

        property bool flipped: false

        front: LoginPage {
            width: parent.width
            height: parent.height
            onSettingsRequested: flipable.flipped = true
        }

        back: LoginSetting {
            width: parent.width
            height: parent.height
            onBackRequested: flipable.flipped = false
        }

        transform: Rotation {
            id: rotation
            origin.x: flipable.width/2
            origin.y: flipable.height/2
            axis.x: 0; axis.y: 1; axis.z: 0
            angle: 0
        }

        states: State {
            name: "back"
            when: flipable.flipped
            PropertyChanges { target: rotation; angle: 180 }
        }

        transitions: Transition {
            NumberAnimation {
                target: rotation
                property: "angle"
                duration: 500
                easing.type: Easing.InOutQuad
            }
        }
    }
}
